import http from '@/components/common/tui-request'


//获取单位工程下拉列表
export const getProjectUnitProjectManageList = (projectId) => {
	return http.request({
		url: `/project-unit-project/getProjectUnitProjectManageList/${projectId}`,
		method: 'GET',
	});
};

//获取分部分项下拉列表
export const getSysSubsectionManageList = () => {
	return http.request({
		url: `/sys-subsection/getSysSubsectionManageList`,
		method: 'GET',
	});
};

//获取分项验收列表
export const getProjectTenderSubsectionList = (projectId,page,limit) => {
	return http.request({
		url: `/project-tender-subsection/getProjectTenderSubsectionList/${projectId}/${page}/${limit}`,
		method: 'GET',
	});
};

//新增分项验收
export const addProjectTenderSubsection = (projectId,data) => {
	return http.request({
		url: `/project-tender-subsection/addProjectTenderSubsection/${projectId}`,
		data:data,
		method: 'POST',
	});
};

//送审
export const startProjectTenderSubsectionProcess = (projectTenderSubsectionId) => {
	return http.request({
		url: `/project-tender-subsection/startProjectTenderSubsectionProcess?projectTenderSubsectionId=${projectTenderSubsectionId}`,
		method: 'POST',
	});
};

//重新送审
export const reStartProjectTenderSubsectionProcess = (projectTenderSubsectionId) => {
	return http.request({
		url: `/project-tender-subsection/reStartProjectTenderSubsectionProcess?projectTenderSubsectionId=${projectTenderSubsectionId}`,
		method: 'POST',
	});
};

//修改检验批
export const updateProjectTenderSubsection = (data) => {
	return http.request({
		url: `/project-tender-subsection/updateProjectTenderSubsection`,
		method: 'PUT',
		data:data
	});
};

//删除检验批
export const deleteUnSubProjectTenderSubsection = (projectTenderSubsectionId) => {
	return http.request({
		url: `/project-tender-subsection/deleteUnSubProjectTenderSubsection/${projectTenderSubsectionId}`,
		method: 'DELETE',
	});
};

//确认审批
export const completeProjectTenderSubsectionTask = (data) => {
	return http.request({
		url: `/project-tender-subsection/completeProjectTenderSubsectionTask`,
		data:data,
		method: 'POST',
	});
};

//通过id获取分项验收全部信息
export const getFullProjectTenderSubsectionInfoById = (projectTenderSubsectionId) => {
	return http.request({
		url: `/project-tender-subsection/getFullProjectTenderSubsectionInfoById?projectTenderSubsectionId=${projectTenderSubsectionId}`,
		method: 'GET',
	});
};

//获取未子分部验收分项工程信息
export const getProjectBranchNoCheckedList = (projectId,projectTenderSubsectionId) => {
	return http.request({
		url: `/project-branch/getProjectBranchNoCheckedList/${projectId}?projectTenderSubsectionId=${projectTenderSubsectionId}`,
		method: 'GET',
	});
};

//获取用户待办及已办数据
export const getTask = (projectId) => {
	return http.request({
		url: `/project-tender-subsection/getTask/${projectId}`,
		method: 'GET',
	});
};